<template>
  <el-form :rules="rules" ref="ruleFormRef" :model="ruleForm" label-width="120px" class="demo-ruleForm" status-icon
           v-loading="data.detail_loading" element-loading-text="正在加载关联对象数据">
    <el-row>
      <el-col :span="12">
        <el-form-item label="申报奖项" prop="awardApplyName">
          <SelectOption :selectValue="ruleForm.awardApplyName" :disabled="addFlag !== 0"
                        :options="options.unitnameList" @change-value="changeValue" />
        </el-form-item>
      </el-col>
      <el-col :span="12">
        <el-form-item label="申报人" prop="applyUser">
          <!-- <SelectOption :selectValue="ruleForm.applyUser" :options="options.userAllList" @change-value="changeValue5">
          </SelectOption> -->
          <user-list-modal
            v-model="ruleForm.applyUser"
            @update:modelValue="changeValue5"
            :default-users="[]"
            :multiple="false"
            :devType="'platform'"
          />
        </el-form-item>
      </el-col>
    </el-row>
    <el-row>
      <el-col :span="12">
        <el-form-item label="申报类型" prop="applyClass">
          <SelectOption :selectValue="ruleForm.applyClass" :disabled="addFlag !== 0"
                        :options="options.gldxList" @change-value="changeValue2"></SelectOption>
        </el-form-item>
      </el-col>
      <el-col :span="12">
        <el-form-item label="申报单位" prop="applyUnitName">

          <popup-tree-input :data="orgAllList" :props="deptForm.popupTreeProps" :prop="deptForm.parentName == null
                          ? $t('message.org.top_menu')
                          : ruleForm.applyUnitName
                        " :node-key="'' + deptForm.parentId" :current-change-handle="changeValue1" />

          <!-- <SelectOption :selectValue="ruleForm.applyUnitName" :options="options.orgAllList" @change-value="changeValue1">
          </SelectOption> -->
        </el-form-item>
      </el-col>

      <!-- <el-col :span="12">
        <el-form-item label="关联类型">
          <SelectOption :selectValue="ruleForm.relateName" :options="options.gldxList" @change-value="changeValue3">
          </SelectOption>
        </el-form-item>
      </el-col> -->
      <el-col :span="12">
        <el-form-item  v-if="ruleForm.awardApplyName === '科技创新成果奖' && ruleForm.applyClassId==='1'"  label="科技奖项名称" prop="relateName" >
          <el-select v-model="ruleForm.relateName" filterable placeholder="请选择科技奖项名称"
                     style="width: 80%" @change="changeProgect" clearable disabled>
            <el-option :label="item.projectname" :value="item.id" :key="item.id"
                       v-for="item in projectList1" />
          </el-select>
          <el-button type="primary" @click="open"  :disabled="addFlag !== 0">选择</el-button>
        </el-form-item>
        <el-form-item  v-if="ruleForm.awardApplyName === '科技创新成果奖' && ruleForm.applyClassId==='2'"  label="专利名称" prop="relateName" >
          <el-select v-model="ruleForm.relateName" filterable placeholder="请选择专利名称"
                     style="width: 80%" @change="changeProgect" clearable disabled>
            <el-option :label="item.projectname" :value="item.id" :key="item.id"
                       v-for="item in projectList1patent" />
          </el-select>
          <el-button type="primary" @click="openpatent"  :disabled="addFlag !== 0">选择</el-button>
        </el-form-item>
        <el-form-item  v-if="ruleForm.awardApplyName === '科技创新成果奖' && ruleForm.applyClassId==='3'"  label="软件著作名称" prop="relateName" >
          <el-select v-model="ruleForm.relateName" filterable placeholder="请选择软件著作名称"
                     style="width: 80%" @change="changeProgect" clearable disabled>
            <el-option :label="item.projectname" :value="item.id" :key="item.id"
                       v-for="item in projectList1softwarecopyright" />
          </el-select>
          <el-button type="primary" @click="opensoftwarecopyright"  :disabled="addFlag !== 0">选择</el-button>
        </el-form-item>
        <el-form-item  v-if="ruleForm.awardApplyName === '科技创新成果奖' && ruleForm.applyClassId==='4'"  label="技术标准名称" prop="relateName" >
          <el-select v-model="ruleForm.relateName" filterable placeholder="请选择技术标准名称"
                     style="width: 80%" @change="changeProgect" clearable disabled>
            <el-option :label="item.projectname" :value="item.id" :key="item.id"
                       v-for="item in projectList1technicalnorms" />
          </el-select>
          <el-button type="primary" @click="opentechnicalnorms"  :disabled="addFlag !== 0">选择</el-button>

        </el-form-item>
        <el-form-item  v-if="ruleForm.awardApplyName === '科技创新成果奖' && ruleForm.applyClassId==='5'"  label="技术工法名称" prop="relateName" >
          <el-select v-model="ruleForm.relateName" filterable placeholder="请选择技术工法名称"
                     style="width: 80%" @change="changeProgect" clearable disabled>
          <el-option :label="item.projectname" :value="item.id" :key="item.id"
                     v-for="item in projectList1tetechnicalmethods" />
        </el-select>
          <el-button type="primary" @click="opentetechnicalmethods"  :disabled="addFlag !== 0">选择</el-button>

        </el-form-item>
        <el-form-item  v-if="ruleForm.awardApplyName === '科技创新成果奖' && ruleForm.applyClassId==='6'"  label="学术论著名称" prop="relateName" >
          <el-select v-model="ruleForm.relateName" filterable placeholder="请选择学术论著名称"
                        style="width: 80%" @change="changeProgect" clearable disabled>
          <el-option :label="item.projectname" :value="item.id" :key="item.id"
                     v-for="item in projectList1composition" />
        </el-select>
          <el-button type="primary" @click="opencomposition"  :disabled="addFlag !== 0">选择</el-button>

        </el-form-item>
        <el-form-item  v-if="ruleForm.awardApplyName === '科技创新成果奖' && ruleForm.applyClassId==='7'"  label="学术论文名称" prop="relateName" >
          <el-select v-model="ruleForm.relateName" filterable placeholder="请选择学术论文名称"
                     style="width: 80%" @change="changeProgect" clearable disabled>
            <el-option :label="item.projectname" :value="item.id" :key="item.id"
                       v-for="item in projectList1thesis" />
          </el-select>
          <el-button type="primary" @click="openthesis"  :disabled="addFlag !== 0">选择</el-button>

        </el-form-item>
        <el-form-item  v-if="ruleForm.awardApplyName === '科技创新成果奖' && ruleForm.applyClassId===''"  label="请选择申报类型" prop="relateName" >
          <SelectOption :selectValue="ruleForm.relateName" :disabled="addFlag !== 0"  placeholder="请选择申报类型"
                        :options="options.dxxqList" @change-value="changeValue4"/>
        </el-form-item>
        <el-form-item  v-if="ruleForm.awardApplyName != '科技创新成果奖'"  label="关联对象">
          <SelectOption :selectValue="ruleForm.relateName" :disabled="addFlag !== 0"
                        :options="options.dxxqList" @change-value="changeValue4"/>
        </el-form-item>
      </el-col>
<!--      <el-col :span="12">
        <el-form-item label="项目名称" prop="projectName">
          <el-input placeholder="如果关联对象自动带出，可编辑" v-model="ruleForm.projectName" style="width:100%" maxlength="50" show-word-limit  />
        </el-form-item>
      </el-col>-->
      <el-col :span="12">
        <el-form-item label="项目编号" prop="projectNo">
          <el-input placeholder="如果关联对象自动带出，可编辑" v-model="ruleForm.projectNo" style="width:100%" maxlength="20" show-word-limit />
        </el-form-item>
      </el-col>
      <el-col :span="12">
        <el-form-item label="申报年份" prop="projectYear">
          <el-select v-model="ruleForm.projectYear" placeholder="请选择" style="width: 100%">
            <el-option :label="item.itemText" :value="item.itemValue"
                       :key="item.itemValue" v-for="item in data.yearList" />
          </el-select>
        </el-form-item>
      </el-col>
    </el-row>
    <el-row>
      <el-form-item label="项目简介" prop="shortIntroduction">
        <el-input :style="{ width: '680px' }" v-model="ruleForm.shortIntroduction" :autosize="{ minRows: 2, maxRows: 6 }"
          type="textarea" placeholder="请输入"  maxlength="200" show-word-limit />
      </el-form-item>

      <el-form-item label="申报单位意见" prop="unitRemark">
        <el-input :style="{ width: '680px' }" v-model="ruleForm.unitRemark" :autosize="{ minRows: 2, maxRows: 6 }"
          type="textarea" placeholder="请输入"  maxlength="200" show-word-limit />
      </el-form-item>

    </el-row>
  </el-form>

  <!-- <el-dialog v-model="data.dialogVisible" width="40%" top="17vh" :show-close="false" :close-on-click-modal="false">
    <template #title>
      <div class="my-header">
        <el-tabs v-model="data.activeName" class="demo-tabs">
          <el-tab-pane :label="data.title" name="first" v-if="data.dialogVisible">
            <SelectOption :options="options.dxxqList" @change-value="changeValue4">
            </SelectOption>
          </el-tab-pane>
        </el-tabs>
        <div class="handle">
          <el-button color="#626aef" @click="data.dialogVisible = false">关闭</el-button>
          <el-button type="primary" @click="data.dialogVisible = false">关联</el-button>
        </div>
      </div>
    </template>
  </el-dialog> -->

  <!-- 科技奖励项目弹窗 -->
  <el-dialog v-model="Visible" width="900px" top="17vh" :show-close="false" :close-on-click-modal="false">
    <template #title>
      <div class="my-header">
        <el-tabs v-model="activeName" class="demo-tabs" v-loading="data.techawardt">
          <el-tab-pane label="项目选择" name="first">
            <div class="search-box">
              <el-input v-model="xiangmuParams.projectName" placeholder="请输入" class="input-with-select"
                        style="width: 300px">
                <template #append>
                  <el-button type="primary" @click="open">搜索</el-button>
                </template>
              </el-input>
            </div>
            <el-table :data="optionsxuze.xiangmuList" style="width: 100%" border
                      @selection-change="handleSelectionChange1">
              <el-table-column type="selection" width="40" />
              <el-table-column prop="awardName" label="项目名称" />
              <el-table-column prop="applyStatus" label="申报状态" />
              <el-table-column prop="applyUnit" label="关联部门" />
              <el-table-column prop="changeName" label="项目负责人" />
              <el-table-column prop="applyUnit" label="申报单位" />
            </el-table>
            <div class="example-pagination-block">
              <el-pagination background layout="prev, pager, next ,total,sizes,jumper"
                             :total="optionsxuze.total"
                             :page-size="xiangmuParams.size"
                             :current-page="xiangmuParams.current"
                             @current-change="handleCurrentChange"
                             @size-change="handleSizeChange" />
            </div>
          </el-tab-pane>
        </el-tabs>
        <div class="handle">
          <el-button color="#626aef" @click="toclose1">关闭</el-button>
          <el-button type="primary" @click="toHandle1">关联</el-button>
        </div>
      </div>
    </template>
  </el-dialog>
  <!-- 专利项目弹窗 -->
  <el-dialog v-model="Visiblepatent" width="900px" top="17vh" :show-close="false" :close-on-click-modal="false">
    <template #title>
      <div class="my-header">
        <el-tabs v-model="activeNamepatent" class="demo-tabs" v-loading="data.patent">
          <el-tab-pane label="项目选择" name="first">
            <div class="search-box">
              <el-input v-model="patentParams.patentName" placeholder="请输入" class="input-with-select"
                        style="width: 300px">
                <template #append>
                  <el-button type="primary" @click="openpatent">搜索</el-button>
                </template>
              </el-input>
            </div>
            <el-table :data="optionspatent.patentList" style="width: 100%" border
                      @selection-change="handleSelectionChange1patent">
              <el-table-column type="selection" width="40" />
              <el-table-column prop="patentId" label="专利号" />
              <el-table-column prop="patentName" label="专利名称" />
              <el-table-column prop="patentUserName" label="专利权人" />
              <el-table-column prop="projectName" label="所属项目" />
              <el-table-column prop="patentType" label="专业类别" />
            </el-table>
            <div class="example-pagination-block">
              <el-pagination background layout="prev, pager, next ,total,sizes,jumper" :total="optionspatent.total"
                             :page-size="patentParams.size" @current-change="handleCurrentChangepatent"
                             @size-change="handleSizeChangepatent" />
            </div>
          </el-tab-pane>
        </el-tabs>
        <div class="handle">
          <el-button color="#626aef" @click="toclose1patent">关闭</el-button>
          <el-button type="primary" @click="toHandle1patent">关联</el-button>
        </div>
      </div>
    </template>
  </el-dialog>
  <!-- 软件著作项目弹窗 -->
  <el-dialog v-model="Visiblesoftwarecopyright" width="900px" top="17vh" :show-close="false" :close-on-click-modal="false">
    <template #title>
      <div class="my-header">
        <el-tabs v-model="activeNamesoftwarecopyright" class="demo-tabs" v-loading="data.softwarecopyright">
          <el-tab-pane label="项目选择" name="first">
            <div class="search-box">
              <el-input v-model="softwarecopyrightParams.name" placeholder="请输入" class="input-with-select"
                        style="width: 300px">
                <template #append>
                  <el-button type="primary" @click="opensoftwarecopyright">搜索</el-button>
                </template>
              </el-input>
            </div>
            <el-table :data="optionssoftwarecopyright.softwarecopyrightList" style="width: 100%" border
                      @selection-change="handleSelectionChange1softwarecopyright">
              <el-table-column type="selection" width="40" />
              <el-table-column prop="registerNo" label="登记号" />
              <el-table-column prop="name" label="软件名称" />
              <el-table-column prop="copyOwner" label="著作权人" />
              <el-table-column prop="projectName" label="所属项目" />
              <el-table-column prop="firstPublicDate" label="首次发表日期" />
            </el-table>
            <div class="example-pagination-block">
              <el-pagination background layout="prev, pager, next ,total,sizes,jumper" :total="optionssoftwarecopyright.total"
                             :page-size="softwarecopyrightParams.size" @current-change="handleCurrentChangesoftwarecopyright"
                             @size-change="handleSizeChangesoftwarecopyright" />
            </div>
          </el-tab-pane>
        </el-tabs>
        <div class="handle">
          <el-button color="#626aef" @click="toclose1softwarecopyright">关闭</el-button>
          <el-button type="primary" @click="toHandle1softwarecopyright">关联</el-button>
        </div>
      </div>
    </template>
  </el-dialog>
  <!-- 技术标准弹窗 -->
  <el-dialog v-model="Visibletechnicalnorms" width="900px" top="17vh" :show-close="false" :close-on-click-modal="false">
    <template #title>
      <div class="my-header">
        <el-tabs v-model="activeNametechnicalnorms" class="demo-tabs" v-loading="data.technicalnorms">
          <el-tab-pane label="项目选择" name="first">
            <div class="search-box">
              <el-input v-model="technicalnormsParams.name" placeholder="请输入" class="input-with-select"
                        style="width: 300px">
                <template #append>
                  <el-button type="primary" @click="opentechnicalnorms">搜索</el-button>
                </template>
              </el-input>
            </div>
            <el-table :data="optionstechnicalnorms.technicalnormsList" style="width: 100%" border
                      @selection-change="handleSelectionChange1technicalnorms">
              <el-table-column type="selection" width="40" />
              <el-table-column prop="code" label="标准编号" />
              <el-table-column prop="name" label="标准名称" />
              <el-table-column prop="business" label="业务板块" />
              <el-table-column prop="editCondition" label="参编情况" />
              <el-table-column prop="publicDate" label="发布时间" />
            </el-table>
            <div class="example-pagination-block">
              <el-pagination background layout="prev, pager, next ,total,sizes,jumper" :total="optionstechnicalnorms.total"
                             :page-size="technicalnormsParams.size" @current-change="handleCurrentChangetechnicalnorms"
                             @size-change="handleSizeChangetechnicalnorms" />
            </div>
          </el-tab-pane>
        </el-tabs>
        <div class="handle">
          <el-button color="#626aef" @click="toclose1technicalnorms">关闭</el-button>
          <el-button type="primary" @click="toHandle1technicalnorms">关联</el-button>
        </div>
      </div>
    </template>
  </el-dialog>
  <!-- 技术工法弹窗 -->
  <el-dialog v-model="Visibletetechnicalmethods" width="900px" top="17vh" :show-close="false" :close-on-click-modal="false">
    <template #title>
      <div class="my-header">
        <el-tabs v-model="activeNametetechnicalmethods" class="demo-tabs" v-loading="data.tetechnicalmethods">
          <el-tab-pane label="项目选择" name="first">
            <div class="search-box">
              <el-input v-model="tetechnicalmethodsParams.constructionName" placeholder="请输入" class="input-with-select"
                        style="width: 300px">
                <template #append>
                  <el-button type="primary" @click="opentetechnicalmethods">搜索</el-button>
                </template>
              </el-input>
            </div>
            <el-table :data="optionstetechnicalmethods.tetechnicalmethodsList" style="width: 100%" border
                      @selection-change="handleSelectionChange1tetechnicalmethods">
              <el-table-column type="selection" width="40" />
              <el-table-column prop="constructionNumber" label="工法编号" />
              <el-table-column prop="constructionName" label="工法名称" />
              <el-table-column prop="trdLevel" label="工法级别" />
              <el-table-column prop="trdClass" label="工法类别" />
              <el-table-column prop="publicDate" label="认定时间" />
            </el-table>
            <div class="example-pagination-block">
              <el-pagination background layout="prev, pager, next ,total,sizes,jumper" :total="optionstetechnicalmethods.total"
                             :page-size="tetechnicalmethodsParams.size" @current-change="handleCurrentChangetetechnicalmethods"
                             @size-change="handleSizeChangetetechnicalmethods" />
            </div>
          </el-tab-pane>
        </el-tabs>
        <div class="handle">
          <el-button color="#626aef" @click="toclose1tetechnicalmethods">关闭</el-button>
          <el-button type="primary" @click="toHandle1tetechnicalmethods">关联</el-button>
        </div>
      </div>
    </template>
  </el-dialog>
  <!-- 学术著作弹窗 -->
  <el-dialog v-model="Visiblecomposition" width="900px" top="17vh" :show-close="false" :close-on-click-modal="false">
    <template #title>
      <div class="my-header">
        <el-tabs v-model="activeNamecomposition" class="demo-tabs" v-loading="data.composition">
          <el-tab-pane label="项目选择" name="first">
            <div class="search-box">
              <el-input v-model="compositionParams.name" placeholder="请输入" class="input-with-select"
                        style="width: 300px">
                <template #append>
                  <el-button type="primary" @click="opencomposition">搜索</el-button>
                </template>
              </el-input>
            </div>
            <el-table :data="optionscomposition.compositionList" style="width: 100%" border
                      @selection-change="handleSelectionChange1composition">
              <el-table-column type="selection" width="40" />
              <el-table-column prop="name" label="著作名称" />
              <el-table-column prop="isbnBookNo" label="标准书ISBN" />
              <el-table-column prop="project" label="所属项目" />
              <el-table-column prop="pyear" label="年份" />
              <el-table-column prop="techClass" label="技术分类" />
            </el-table>
            <div class="example-pagination-block">
              <el-pagination background layout="prev, pager, next ,total,sizes,jumper" :total="optionscomposition.total"
                             :page-size="compositionParams.size" @current-change="handleCurrentChangecomposition"
                             @size-change="handleSizeChangecomposition" />
            </div>
          </el-tab-pane>
        </el-tabs>
        <div class="handle">
          <el-button color="#626aef" @click="toclose1composition">关闭</el-button>
          <el-button type="primary" @click="toHandle1composition">关联</el-button>
        </div>
      </div>
    </template>
  </el-dialog>
  <!-- 学术论文弹窗 -->
  <el-dialog v-model="Visiblethesis" width="900px" top="17vh" :show-close="false" :close-on-click-modal="false">
    <template #title>
      <div class="my-header">
        <el-tabs v-model="activeNamethesis" class="demo-tabs" v-loading="data.thesis">
          <el-tab-pane label="项目选择" name="first">
            <div class="search-box">
              <el-input v-model="thesisParams.title" placeholder="请输入" class="input-with-select"
                        style="width: 300px">
                <template #append>
                  <el-button type="primary" @click="openthesis">搜索</el-button>
                </template>
              </el-input>
            </div>
            <el-table :data="optionsthesis.thesisList" style="width: 100%" border
                      @selection-change="handleSelectionChange1thesis">
              <el-table-column type="selection" width="40" />
              <el-table-column prop="magazineName" label="期刊名称" />
              <el-table-column prop="title" label="论文题目" />
              <el-table-column prop="project" label="所属项目" />
              <el-table-column prop="techClass" label="技术分类" />
              <el-table-column prop="publicDate" label="发表日期" />
            </el-table>
            <div class="example-pagination-block">
              <el-pagination background layout="prev, pager, next ,total,sizes,jumper" :total="optionsthesis.total"
                             :page-size="thesisParams.size" @current-change="handleCurrentChangethesis"
                             @size-change="handleSizeChangethesis" />
            </div>
          </el-tab-pane>
        </el-tabs>
        <div class="handle">
          <el-button color="#626aef" @click="toclose1thesis">关闭</el-button>
          <el-button type="primary" @click="toHandle1thesis">关联</el-button>
        </div>
      </div>
    </template>
  </el-dialog>


</template>

<script lang="ts">
import UserListModal from '@/views/project/components/UserListModal/index.vue';
import Api from '@/views/science/api/awards';
import { getDetailById, getTable } from "@/views/science/api/patent";
import PopupTreeInput from '@/views/science/components/PopupTreeInput/index.vue';
import SelectOption from '@/views/science/components/selectOption/index.vue';
import Table from '@/views/science/components/table/table.vue';
import {computed, onMounted, reactive, ref, watch, watchEffect} from 'vue';
import { useStore } from 'vuex';
// import {projectManagementListPage} from "@/views/science/technologyStrength/api/technologyStrength";
import {tips} from "@/views/science/components/tips/tips";
import {
  getProject,
  projectManagementListPage,
  techawardtListPage,
  patentListPage,
  softwarecopyrightListPage,
  technicalnormsListPage,
  tetechnicalmethodsListPage, compositionListPage, thesisListPage,
} from "@/views/science/api/achievements";
export default {
  components: {
    SelectOption,
    Table,
    UserListModal,
    PopupTreeInput
  },

  emits: {
    valueFlag: null,
    awardType: null,
  },
  props: {
    addFlag: {
      type: Number,
      required: true,
    },

    orgAllList: {
      type: Array,
      required: true,
    },

  },
  setup(props, { emit }) {

    const deptForm = {
      parentId: 0,
      parentName: '',
      popupTreeProps: {
        label: 'name',
        children: 'children',
        value: 'id',
        checkStrictly: true,
      },
    }

    const store = useStore() // 获取vuex的数据
    const labelPosition = ref('right')  // 表单label位置

    const data = reactive({
      activeName: ref('first'),  // 弹窗中的tab切换
      dialogVisible: false,
      isFlag: false,
      detail_loading:false,
      title: '',
      page: { page: 1, limit: 10, total: 0 },
      ids: [],
      params: {
        current: 1,
        id: "",
        name: "",
        size: 10
      },
      allTableData: [],
      columns: [
        {
          key: 'name',
          width: 140,
          label: '合同名称',
        },
        {
          key: 'changeTime',
          width: 140,
          label: '合同编号',
        },
        {
          key: 'changeNode',
          width: 140,
          label: '项目名称',
        },
        {
          key: 'changeBefore',
          width: 140,
          label: '起止时间',
        },
        {
          key: 'changeAfter',
          width: 140,
          label: '项目负责人',
        },
      ],
      addFlag: computed(() => store.state.technologyStrength.addFlag),
      yearList: [
        { itemText: '2026年', itemValue: '2026' },
        { itemText: '2025年', itemValue: '2025' },
        { itemText: '2024年', itemValue: '2024' },
        { itemText: '2023年', itemValue: '2023' },
        { itemText: '2022年', itemValue: '2022' },
        { itemText: '2021年', itemValue: '2021' },
        { itemText: '2020年', itemValue: '2020' },
        { itemText: '2019年', itemValue: '2019' },
        { itemText: '2018年', itemValue: '2018' },
      ],//年份
      awardSelect: {
        sbjx: null,
        sblx: null,
        pants: null, //附表信息-科技创新成果奖-科学奖项
        patents: null, //附表信息-科技创新成果奖-发明专利
        softwarecopyrights: null, //科技创新成果奖-软件著作权
        composition: null, //科技创新成果奖-学术著作
        thesis: null, //科技创新成果奖-学术论文
        technicalnorms: null, //科技创新成果奖-技术标准
        technicalmethods: null, //科技创新成果奖-技术工法
        projects: null, //重大科技项目立项奖
        innovate: null, //创新平台建设奖
      },
      // projectList,
      projectList1: [],//科技奖励项目
      techawardt:false,
      projectList1patent: [],//专利项目
      patent:false,
      projectList1softwarecopyright: [],//软件著作项目
      softwarecopyright:false,
      projectList1technicalnorms: [],//技术标准项目
      technicalnorms:false,
      projectList1tetechnicalmethods: [],//技术工法项目
      tetechnicalmethods:false,
      projectList1composition: [],//学术著作项目
      composition:false,
      projectList1thesis: [],//学术论文项目
      thesis:false,
    })
    // 发送请求
    onMounted(() => {
      // getProjectList()
    });
    // 科技奖励项目

    // 科技奖励项目弹窗中的选择
    let optionsxuze = reactive({
      xiangmuList: [], //项目列表
      projectList: [],
      contractList: [],
      total: 0,
      isHightPayList: [
        { text: '否', value: '1', },
        { text: '是', value: '0', },
      ],
    })
    let Visible = ref(false)
   //项目搜索参数
    let xiangmuParams = reactive({
      projectName: '',
      projectNumber: '',
      createOrgId: '',
      level: '',
      current: 1,
      size: 10,
      projectCategory: '1',
    })
/*     //项目搜索参数
    let xiangmuParams = ref({
      projectName: '',
      projectNumber: '',
      createOrgId: '',
      level: '',
      current: 1,
      size: 10,
      projectCategory: '1',
    });*/
    //项目列表
    let open = async () => {
      xiangmuParams.size = 10;
      xiangmuParams.current = 1;
      // const res = await projectManagementListPage(xiangmuParams)
      await getProjectData()
    };
    const getProjectData = async () => {
      data.techawardt=true;
      data.detail_loading =true;
      const res = await techawardtListPage(xiangmuParams)
      if(res.data.code == '200'){
        const rs = res.data.data
        optionsxuze.xiangmuList = rs.records
        optionsxuze.total = rs.total
        data.techawardt = false;
        Visible.value = true;
        data.detail_loading = false;
      }
    }
    //改变页码
    const handleCurrentChange = (e) => {
      xiangmuParams.current = e || 1;
      getProjectData().then()
    }
    //改变页数限制
    const handleSizeChange = (e) => {
      xiangmuParams.size = e || 10;
      getProjectData().then()
    }
    let changeList = ref([])
    let activeName = ref('first')
    let isShow = ref(false)
    let isProject = ref(false)
    let select1 = ref([]) //项目
    let handleSelectionChange1 = (val) => {
      select1.value = val
    }
    const toHandle1 = () => {
      if (select1.value.length != 1) {
        tips('请选择一项关联', 'warning')
        return
      } else {
        let obj = select1.value[0]
        ruleForm.relateId  = (obj as any).id
        ruleForm.relateName= (obj as any).awardName
        Visible.value = false;
        optionsxuze.total = 0;
      }
    }
    const toclose1 = () => {
/*      xiangmuParams.size = 10;
      xiangmuParams.current = 1;
      optionsxuze.total = 0;*/
      Visible.value = false;
      xiangmuParams.size = 10;
      xiangmuParams.current = 1;
    }
/*    Api.getProjectList().then((res) => {
      // console.log('项目列表', res.data.data)
      optionsxuze.projectList = res.data.data
    });*/
    // 专利项目
    // 科技奖励项目弹窗中的选择
    let optionspatent = reactive({
      patentList: [], //项目列表
      projectList: [],
      contractList: [],
      total: 0,
      isHightPayList: [
        { text: '否', value: '1', },
        { text: '是', value: '0', },
      ],
    })
    let Visiblepatent = ref(false)
    //项目搜索参数
    let patentParams = reactive({
      patentId:'',
      patentName: "",
      patentUserName: "",
      patentClassId: '',
      isContractSuccess: '',
      current: 1,
      size: 10,
    })
    /*     //项目搜索参数
        let xiangmuParams = ref({
          projectName: '',
          projectNumber: '',
          createOrgId: '',
          level: '',
          current: 1,
          size: 10,
          projectCategory: '1',
        });*/
    //项目列表
    let openpatent = async () => {
      data.patent=true;
      data.detail_loading =true;
      // const res = await projectManagementListPage(xiangmuParams)
      // optionspatent.total = 0;
      const res = await patentListPage(patentParams)
      if(res.data.code == '200'){
        const rs = res.data.data
        console.log(1111,rs)
        console.log(2222,patentParams)
        optionspatent.patentList = rs.records
        optionspatent.total = rs.total
        data.patent = false;
        Visiblepatent.value = true;
        data.detail_loading = false;
        patentParams.size = 10;
        patentParams.current = 1;
      }else{
        data.patent = false;
        Visiblepatent.value = true;
        data.detail_loading = false;
        patentParams.size = 10;
        patentParams.current = 1;
        tips("服务器请求失败请稍后", "success");
      }

    };
    //改变页码
    const handleCurrentChangepatent = (e) => {
      patentParams.current = e
      openpatent()
    }
    //改变页数限制
    const handleSizeChangepatent = (e) => {
      patentParams.size = e
      openpatent()
    }
    let changeListpatent = ref([])
    let activeNamepatent = ref('first')
    let isShowpatent = ref(false)
    let isProjectpatent = ref(false)
    let select1patent = ref([]) //项目
    let handleSelectionChange1patent = (val) => {
      select1patent.value = val
    }
    const toHandle1patent = () => {
      if (select1patent.value.length != 1) {
        tips('请选择一项关联', 'warning')
        return
      } else {
        let obj = select1patent.value[0]
        ruleForm.relateId  = (obj as any).id
        ruleForm.relateName= (obj as any).patentName
        Visiblepatent.value = false;
        optionspatent.total = 0;
      }
    }
    const toclose1patent = () => {
      Visiblepatent.value = false;
      patentParams.size = 10;
      patentParams.current = 1;
    }
    // 软件著作项目
    let optionssoftwarecopyright = reactive({
      softwarecopyrightList: [], //项目列表
      projectList: [],
      contractList: [],
      total: 0,
      isHightPayList: [
        { text: '否', value: '1', },
        { text: '是', value: '0', },
      ],
    })
    let Visiblesoftwarecopyright = ref(false)
    //项目搜索参数
    let softwarecopyrightParams = reactive({
      name: "",
      maintainUnitId: "",
      softStateId: "",
      isContractSuccess: "",
      current: 1,
      size: 10,
    })
    /*     //项目搜索参数
        let xiangmuParams = ref({
          projectName: '',
          projectNumber: '',
          createOrgId: '',
          level: '',
          current: 1,
          size: 10,
          projectCategory: '1',
        });*/
    //项目列表
    let opensoftwarecopyright = async () => {
      data.softwarecopyright=true;
      data.detail_loading =true;
      // const res = await projectManagementListPage(xiangmuParams)
      // optionspatent.total = 0;
      const res = await softwarecopyrightListPage(softwarecopyrightParams)
      if(res.data.code == '200'){
        const rs = res.data.data
        console.log(1111,rs)
        console.log(2222,softwarecopyrightParams)
        optionssoftwarecopyright.softwarecopyrightList = rs.records
        optionssoftwarecopyright.total = rs.total
        data.softwarecopyright = false;
        Visiblesoftwarecopyright.value = true;
        data.detail_loading = false;
        softwarecopyrightParams.size = 10;
        softwarecopyrightParams.current = 1;
      }else{
        data.softwarecopyright = false;
        Visiblesoftwarecopyright.value = true;
        data.detail_loading = false;
        softwarecopyrightParams.size = 10;
        softwarecopyrightParams.current = 1;
        tips("服务器请求失败请稍后", "success");
      }

    };
    //改变页码
    const handleCurrentChangesoftwarecopyright = (e) => {
      softwarecopyrightParams.current = e
      opensoftwarecopyright()
    }
    //改变页数限制
    const handleSizeChangesoftwarecopyright = (e) => {
      softwarecopyrightParams.size = e
      opensoftwarecopyright()
    }
    let changeListsoftwarecopyright = ref([])
    let activeNamesoftwarecopyright = ref('first')
    let isShowsoftwarecopyright = ref(false)
    let isProjectsoftwarecopyright = ref(false)
    let select1softwarecopyright = ref([]) //项目
    let handleSelectionChange1softwarecopyright = (val) => {
      select1softwarecopyright.value = val
    }
    const toHandle1softwarecopyright = () => {
      if (select1softwarecopyright.value.length != 1) {
        tips('请选择一项关联', 'warning')
        return
      } else {
        let obj = select1softwarecopyright.value[0]
        ruleForm.relateId  = (obj as any).id
        ruleForm.relateName= (obj as any).name
        Visiblesoftwarecopyright.value = false;
        optionssoftwarecopyright.total = 0;
      }
    }
    const toclose1softwarecopyright = () => {
      Visiblesoftwarecopyright.value = false;
      softwarecopyrightParams.size = 10;
      softwarecopyrightParams.current = 1;
    }
    // 技术标准项目
    let optionstechnicalnorms = reactive({
      technicalnormsList: [], //项目列表
      projectList: [],
      contractList: [],
      total: 0,
      isHightPayList: [
        { text: '否', value: '1', },
        { text: '是', value: '0', },
      ],
    })
    let Visibletechnicalnorms = ref(false)
    //项目搜索参数
    let technicalnormsParams = reactive({
      name: "",
      maintainUnitId: "",
      softStateId: "",
      isContractSuccess: "",
      current: 1,
      size: 10,
    })
    /*     //项目搜索参数
        let xiangmuParams = ref({
          projectName: '',
          projectNumber: '',
          createOrgId: '',
          level: '',
          current: 1,
          size: 10,
          projectCategory: '1',
        });*/
    //项目列表
    let opentechnicalnorms = async () => {
      data.technicalnorms=true;
      data.detail_loading =true;
      // const res = await projectManagementListPage(xiangmuParams)
      // optionspatent.total = 0;
      const res = await technicalnormsListPage(technicalnormsParams)
      if(res.data.code == '200'){
        const rs = res.data.data
        console.log(1111,rs)
        console.log(2222,technicalnormsParams)
        optionstechnicalnorms.technicalnormsList = rs.records
        optionstechnicalnorms.total = rs.total
        data.technicalnorms = false;
        Visibletechnicalnorms.value = true;
        data.detail_loading = false;
        technicalnormsParams.size = 10;
        technicalnormsParams.current = 1;
      }else{
        data.technicalnorms = false;
        Visibletechnicalnorms.value = true;
        data.detail_loading = false;
        technicalnormsParams.size = 10;
        technicalnormsParams.current = 1;
        tips("服务器请求失败请稍后", "success");
      }

    };
    //改变页码
    const handleCurrentChangetechnicalnorms = (e) => {
      technicalnormsParams.current = e
      opentechnicalnorms()
    }
    //改变页数限制
    const handleSizeChangetechnicalnorms = (e) => {
      technicalnormsParams.size = e
      opentechnicalnorms()
    }
    let changeListtechnicalnorms = ref([])
    let activeNametechnicalnorms = ref('first')
    let isShowtechnicalnorms = ref(false)
    let isProjecttechnicalnorms = ref(false)
    let select1technicalnorms = ref([]) //项目
    let handleSelectionChange1technicalnorms = (val) => {
      select1technicalnorms.value = val
    }
    const toHandle1technicalnorms = () => {
      if (select1technicalnorms.value.length != 1) {
        tips('请选择一项关联', 'warning')
        return
      } else {
        let obj = select1technicalnorms.value[0]
        ruleForm.relateId  = (obj as any).id
        ruleForm.relateName= (obj as any).name
        Visibletechnicalnorms.value = false;
        optionstechnicalnorms.total = 0;
      }
    }
    const toclose1technicalnorms = () => {
      Visibletechnicalnorms.value = false;
      technicalnormsParams.size = 10;
      technicalnormsParams.current = 1;
    }
    // 技术工法项目
    let optionstetechnicalmethods = reactive({
      tetechnicalmethodsList: [], //项目列表
      projectList: [],
      contractList: [],
      total: 0,
      isHightPayList: [
        { text: '否', value: '1', },
        { text: '是', value: '0', },
      ],
    })
    let Visibletetechnicalmethods = ref(false)
    //项目搜索参数
    let tetechnicalmethodsParams = reactive({
      constructionName: '',
      levelName: '',
      normType: '',
      trdClass: '',
      trdLevelId: '',
      trdClassId: '',
      mainUnit: '',
      enterpriseRankingId: '',
      current: 1,
      size: 10,
    })
    /*     //项目搜索参数
        let xiangmuParams = ref({
          projectName: '',
          projectNumber: '',
          createOrgId: '',
          level: '',
          current: 1,
          size: 10,
          projectCategory: '1',
        });*/
    //项目列表
    let opentetechnicalmethods = async () => {
      data.tetechnicalmethods=true;
      data.detail_loading =true;
      // const res = await projectManagementListPage(xiangmuParams)
      // optionspatent.total = 0;
      const res = await tetechnicalmethodsListPage(tetechnicalmethodsParams)
      if(res.data.code == '200'){
        const rs = res.data.data
        console.log(1111,rs)
        console.log(2222,tetechnicalmethodsParams)
        optionstetechnicalmethods.tetechnicalmethodsList = rs.records
        optionstetechnicalmethods.total = rs.total
        data.tetechnicalmethods = false;
        Visibletetechnicalmethods.value = true;
        data.detail_loading = false;
        tetechnicalmethodsParams.size = 10;
        tetechnicalmethodsParams.current = 1;
      }else{
        data.tetechnicalmethods = false;
        Visibletetechnicalmethods.value = true;
        data.detail_loading = false;
        tetechnicalmethodsParams.size = 10;
        tetechnicalmethodsParams.current = 1;
        tips("服务器请求失败请稍后", "success");
      }

    };
    //改变页码
    const handleCurrentChangetetechnicalmethods = (e) => {
      tetechnicalmethodsParams.current = e
      opentetechnicalmethods()
    }
    //改变页数限制
    const handleSizeChangetetechnicalmethods = (e) => {
      tetechnicalmethodsParams.size = e
      opentetechnicalmethods()
    }
    let changeListtetechnicalmethods = ref([])
    let activeNametetechnicalmethods = ref('first')
    let isShowtetechnicalmethods = ref(false)
    let isProjecttetechnicalmethods = ref(false)
    let select1tetechnicalmethods = ref([]) //项目
    let handleSelectionChange1tetechnicalmethods = (val) => {
      select1tetechnicalmethods.value = val
    }
    const toHandle1tetechnicalmethods = () => {
      if (select1tetechnicalmethods.value.length != 1) {
        tips('请选择一项关联', 'warning')
        return
      } else {
        let obj = select1tetechnicalmethods.value[0]
        ruleForm.relateId  = (obj as any).id
        ruleForm.relateName= (obj as any).constructionName
        Visibletetechnicalmethods.value = false;
        optionstetechnicalmethods.total = 0;
      }
    }
    const toclose1tetechnicalmethods = () => {
      Visibletetechnicalmethods.value = false;
      tetechnicalmethodsParams.size = 10;
      tetechnicalmethodsParams.current = 1;
    }
    // 学术著作
    let optionscomposition = reactive({
      compositionList: [], //项目列表
      projectList: [],
      contractList: [],
      total: 0,
      isHightPayList: [
        { text: '否', value: '1', },
        { text: '是', value: '0', },
      ],
    })
    let Visiblecomposition = ref(false)
    //项目搜索参数
    let compositionParams = reactive({
      name: "",
      maintainUnitId: '',
      workLevelId: "",
      pyear: '',
      isContractSuccess: '',
      current: 1,
      size: 10,
    })
    /*     //项目搜索参数
        let xiangmuParams = ref({
          projectName: '',
          projectNumber: '',
          createOrgId: '',
          level: '',
          current: 1,
          size: 10,
          projectCategory: '1',
        });*/
    //项目列表
    let opencomposition = async () => {
      data.composition=true;
      data.detail_loading =true;
      // const res = await projectManagementListPage(xiangmuParams)
      // optionspatent.total = 0;
      const res = await compositionListPage(compositionParams)
      if(res.data.code == '200'){
        const rs = res.data.data
        console.log(1111,rs)
        console.log(2222,compositionParams)
        optionscomposition.compositionList = rs.records
        optionscomposition.total = rs.total
        data.composition = false;
        Visiblecomposition.value = true;
        data.detail_loading = false;
        compositionParams.size = 10;
        compositionParams.current = 1;
      }else{
        data.composition = false;
        Visiblecomposition.value = true;
        data.detail_loading = false;
        compositionParams.size = 10;
        compositionParams.current = 1;
        tips("服务器请求失败请稍后", "success");
      }

    };
    //改变页码
    const handleCurrentChangecomposition = (e) => {
      compositionParams.current = e
      opencomposition()
    }
    //改变页数限制
    const handleSizeChangecomposition = (e) => {
      tetechnicalmethodsParams.size = e
      opentetechnicalmethods()
    }
    let changeListcomposition = ref([])
    let activeNamecomposition = ref('first')
    let isShowcomposition = ref(false)
    let isProjectcomposition = ref(false)
    let select1composition = ref([]) //项目
    let handleSelectionChange1composition = (val) => {
      select1composition.value = val
    }
    const toHandle1composition = () => {
      if (select1composition.value.length != 1) {
        tips('请选择一项关联', 'warning')
        return
      } else {
        let obj = select1composition.value[0]
        ruleForm.relateId  = (obj as any).id
        ruleForm.relateName= (obj as any).name
        Visiblecomposition.value = false;
        optionscomposition.total = 0;
      }
    }
    const toclose1composition = () => {
      Visiblecomposition.value = false;
      compositionParams.size = 10;
      compositionParams.current = 1;
    }
    // 学术论文
    let optionsthesis = reactive({
      thesisList: [], //项目列表
      projectList: [],
      contractList: [],
      total: 0,
      isHightPayList: [
        { text: '否', value: '1', },
        { text: '是', value: '0', },
      ],
    })
    let Visiblethesis = ref(false)
    //项目搜索参数
    let thesisParams = reactive({
      title: "",
      magazineName: "",
      maintainUnitId: "",
      techClassId: "",
      isContractSuccess: "",
      current: 1,
      size: 10,
    })
    /*     //项目搜索参数
        let xiangmuParams = ref({
          projectName: '',
          projectNumber: '',
          createOrgId: '',
          level: '',
          current: 1,
          size: 10,
          projectCategory: '1',
        });*/
    //项目列表
    let openthesis = async () => {
      data.composition=true;
      data.detail_loading =true;
      // const res = await projectManagementListPage(xiangmuParams)
      // optionspatent.total = 0;
      const res = await thesisListPage(thesisParams)
      if(res.data.code == '200'){
        const rs = res.data.data
        console.log(1111,rs)
        console.log(2222,thesisParams)
        optionsthesis.thesisList = rs.records
        optionsthesis.total = rs.total
        data.composition = false;
        Visiblethesis.value = true;
        data.detail_loading = false;
        thesisParams.size = 10;
        thesisParams.current = 1;
      }else{
        data.thesis = false;
        Visiblethesis.value = true;
        data.detail_loading = false;
        thesisParams.size = 10;
        thesisParams.current = 1;
        tips("服务器请求失败请稍后", "success");
      }

    };
    //改变页码
    const handleCurrentChangethesis = (e) => {
      compositionParams.current = e
      opencomposition()
    }
    //改变页数限制
    const handleSizeChangethesis = (e) => {
      tetechnicalmethodsParams.size = e
      opentetechnicalmethods()
    }
    let changeListthesis = ref([])
    let activeNamethesis = ref('first')
    let isShowthesis = ref(false)
    let isProjectthesis = ref(false)
    let select1thesis = ref([]) //项目
    let handleSelectionChange1thesis = (val) => {
      select1thesis.value = val
    }
    const toHandle1thesis = () => {
      if (select1thesis.value.length != 1) {
        tips('请选择一项关联', 'warning')
        return
      } else {
        let obj = select1thesis.value[0]
        ruleForm.relateId  = (obj as any).id
        ruleForm.relateName= (obj as any).title
        Visiblethesis.value = false;
        optionsthesis.total = 0;
      }
    }
    const toclose1thesis = () => {
      Visiblethesis.value = false;
      thesisParams.size = 10;
      thesisParams.current = 1;
    }

    // 弹窗中三个下拉选择
    let options = reactive({
      projectnameList: computed(() => store.state.technologyStrength.KJSL_DECLARATION_TYPE),
      // unitnameList: computed(() => store.state.technologyStrength.KJSL_APPLYING_FOR_AWARDS1),
      userAllList: computed(() => store.state.technologyStrength.userAllList),
      orgAllList: computed(() => store.state.technologyStrength.orgAllList),
      unitnameList: [
        {
          id: 1,
          itemText: '科技创新成果奖',
          itemValue: '1',
        },
        {
          id: 2,
          itemText: '重大科技项目立项奖',
          itemValue: '2',
        },
        {
          id: 3,
          itemText: '创新平台建设奖',
          itemValue: '3',
        },
      ],
      gldxList: [
        {
          id: 1,
          itemText: '科技奖项',
          itemValue: '1',
        },
        {
          id: 2,
          itemText: '发明专利',
          itemValue: '2',
        },
        {
          id: 3,
          itemText: '软件著作权',
          itemValue: '3',
        },
        {
          id: 4,
          itemText: '技术标准',
          itemValue: '4',
        },
        {
          id: 5,
          itemText: '技术工法',
          itemValue: '5',
        },
        {
          id: 6,
          itemText: '学术论著',
          itemValue: '6',
        },
        {
          id: 7,
          itemText: '学术论文',
          itemValue: '7',
        }
      ],
      dxxqList: []
    })

    watchEffect(() => {
      if(props.addFlag == 0){
        Object.keys(data.awardSelect).forEach((key) => {
          data.awardSelect[key] = null
        })
      }
    })

    const ruleForm = reactive(store.state.technologyStrength.achievementINFO)
    watch(ruleForm, (newValue, oldValue) => {
      store.commit('technologyStrength/getachievementINFO', { ...ruleForm })
    });


    const changeValue = (item) => {
      ruleForm.awardApplyName = item.itemText
      ruleForm.awardApplyId = item.itemValue
      data.awardSelect.sbjx = item.id
      emit('awardType', data.awardSelect)
    }
    const changeValue1 = (item) => {
      ruleForm.applyUnitName = item.name
      ruleForm.applyUnitId = item.id
    }
    const changeValue2 = (item) => {
      data.detail_loading = true;
      ruleForm.relateName='';
      ruleForm.relateId = '';
      ruleForm.applyClass = item.itemText;
      ruleForm.applyClassId = item.itemValue;
      ruleForm.relatetype = '';
      ruleForm.relatetypeName = '';
      if(item.itemText == "发明专利" ){
          getTable({
            current:1,
            size:999,
            patentId:'',
            patentName: "",
            patentUserName: "",
            patentClassId: '',
          }).then((res) => {
            res.data.data.records.forEach(e => {
              e.name = e.patentName
            });
            options.dxxqList = res.data.data.records
            data.detail_loading = false;
          });

      } else {
          Api.gldxList({
          relatetype: item.id
        })
          .then((res) => {
            options.dxxqList = res.data.data;
            data.detail_loading = false;
          })
      }
      data.awardSelect.sblx = item.id;
      emit('awardType', data.awardSelect);

    }
    const changeValue3 = (item) => {
      console.log(item)
    }

    const changeValue4 = (item) => {
      ruleForm.relateId = item.id;
      ruleForm.relateName = item.name;
      if (data.awardSelect.sbjx == 1) {
        if (data.awardSelect.sblx == 1) {
          Api.kjjxList(item.id)
            .then((res) => {
              data.awardSelect.pants = res.data.data.info
              emit('awardType', data.awardSelect)
            })
        } else if (data.awardSelect.sblx == 2) {
          // data.awardSelect.patents = res.data.data[0]
          getDetailById(item.applyCode).then(res =>{
            data.awardSelect.patents = res.data.data.baseInfo
            emit('awardType', data.awardSelect)
            // console.log('关联对象2',res.data.data.baseInfo);
          })
        } else if (data.awardSelect.sblx == 3) {
          Api.xszzList(item.id)
            .then((res) => {
              data.awardSelect.softwarecopyrights = res.data.data.info
              emit('awardType', data.awardSelect)
            })
        } else if (data.awardSelect.sblx == 4) {
          Api.jsbzList(item.id)
            .then((res) => {
              data.awardSelect.technicalnorms = res.data.data.info
              emit('awardType', data.awardSelect)
            })
        } else if (data.awardSelect.sblx == 5) {
          Api.jsgfList(item.id)
            .then((res) => {
              data.awardSelect.technicalmethods = res.data.data.info
              emit('awardType', data.awardSelect)
            })
        } else if (data.awardSelect.sblx == 6) {
          Api.xslzList(item.id)
            .then((res) => {
              data.awardSelect.composition = res.data.data.info
              emit('awardType', data.awardSelect)
            })
        } else if (data.awardSelect.sblx == 7) {
          Api.xslwList(item.id)
            .then((res) => {
              data.awardSelect.thesis = res.data.data.info
              emit('awardType', data.awardSelect)
            })
        }
      } else if (data.awardSelect.sbjx == 2) {
        // data.awardSelect.projects = res.data.data[0]
      } else if (data.awardSelect.sbjx == 3) {
        // data.awardSelect.innovate = res.data.data[0]
      }
    }

    const changeValue5 = (item) => {
      ruleForm.applyUserId = item.userId
      ruleForm.applyUser = item.cname
    }
    const changeValue6 = (item) => {
      // ruleForm.applyUserId = item.userId
      // ruleForm.applyUser = item.cname
    }

    const delectIds = (ids) => {
      data.ids = ids
    }

    const currentChange = (current) => {
      console.log(current)
    }

    // 新增
    const rules = reactive({

      awardApplyName: [
        { required: true, message: '请选择申报奖项', trigger: 'change', },
      ],
      applyClass: [
        { required: true, message: '请选择申报类型', trigger: 'change', },
      ],
      applyUnitName: [
        { required: true, message: '请选择申报单位', trigger: 'change', },
      ],
      relateName: [
        { required: true, message: '请选择关联对象名称', trigger: 'change', },
      ],
      projectName: [
        { required: true, message: '请输入项目名称', trigger: 'blur' },
      ],
      projectNo: [
        { required: true, message: '请输入项目编号', trigger: 'change', },
      ],
      projectYear: [
        { required: true, message: '请选择申请年份', trigger: 'change', },
      ],
      shortIntroduction: [
        { required: true, message: '请输入项目简介', trigger: 'blur', },
      ],
      unitRemark: [
        { required: true, message: '请输入申报单位意见', trigger: 'blur' },
      ],
    })

    const ruleFormRef = ref()
    const submitForm = async () => {
      await ruleFormRef.value.validate((valid, fields) => {
        if (valid) {
          emit('valueFlag', true)
          console.log('submit!')
        } else {
          emit('valueFlag', false)
        }
      })
    }
    return {
      deptForm,
      submitForm,
      ruleForm,
      rules,
      ruleFormRef,
      labelPosition,
      data,
      options,
      delectIds,
      currentChange,

      changeValue,
      changeValue1,
      changeValue2,
      changeValue3,
      changeValue4,
      changeValue5,
      changeValue6,//科技奖励项目
      open,
      Visible,
      optionsxuze,
      handleSelectionChange1,
      handleCurrentChange,
      handleSizeChange,
      toHandle1,
      toclose1,
      changeList,
      activeName,
      isShow,
      isProject,
      xiangmuParams,
      openpatent,//专利
      Visiblepatent,
      optionspatent,
      handleSelectionChange1patent,
      handleCurrentChangepatent,
      handleSizeChangepatent,
      toHandle1patent,
      toclose1patent,
      changeListpatent,
      activeNamepatent,
      isShowpatent,
      isProjectpatent,
      patentParams,
      opensoftwarecopyright,//软件著作
      Visiblesoftwarecopyright,
      optionssoftwarecopyright,
      handleSelectionChange1softwarecopyright,
      handleCurrentChangesoftwarecopyright,
      handleSizeChangesoftwarecopyright,
      toHandle1softwarecopyright,
      toclose1softwarecopyright,
      changeListsoftwarecopyright,
      activeNamesoftwarecopyright,
      isShowsoftwarecopyright,
      isProjectsoftwarecopyright,
      softwarecopyrightParams,
      opentechnicalnorms,//技术标准
      Visibletechnicalnorms,
      optionstechnicalnorms,
      handleSelectionChange1technicalnorms,
      handleCurrentChangetechnicalnorms,
      handleSizeChangetechnicalnorms,
      toHandle1technicalnorms,
      toclose1technicalnorms,
      changeListtechnicalnorms,
      activeNametechnicalnorms,
      isShowtechnicalnorms,
      isProjecttechnicalnorms,
      technicalnormsParams,
      opentetechnicalmethods,//技术工法
      Visibletetechnicalmethods,
      optionstetechnicalmethods,
      handleSelectionChange1tetechnicalmethods,
      handleCurrentChangetetechnicalmethods,
      handleSizeChangetetechnicalmethods,
      toHandle1tetechnicalmethods,
      toclose1tetechnicalmethods,
      changeListtetechnicalmethods,
      activeNametetechnicalmethods,
      isShowtetechnicalmethods,
      isProjecttetechnicalmethods,
      tetechnicalmethodsParams,
      opencomposition,//学术著作
      Visiblecomposition,
      optionscomposition,
      handleSelectionChange1composition,
      handleCurrentChangecomposition,
      handleSizeChangecomposition,
      toHandle1composition,
      toclose1composition,
      changeListcomposition,
      activeNamecomposition,
      isShowcomposition,
      isProjectcomposition,
      compositionParams,
      openthesis,//学术论文
      Visiblethesis,
      optionsthesis,
      handleSelectionChange1thesis,
      handleCurrentChangethesis,
      handleSizeChangethesis,
      toHandle1thesis,
      toclose1thesis,
      changeListthesis,
      activeNamethesis,
      isShowthesis,
      isProjectthesis,
      thesisParams,



    }


  },
}


</script>
<style lang="scss" scoped>
.my-header {
  padding-bottom: 40px;
}

.demo-form-inline .el-form-item {
  width: 48%;
}

:deep(.labelHeight .el-form-item__label) {
  line-height: 20px;
}

:deep(.el-date-editor.el-input) {
  width: 100%;
}

:deep(.el-date-editor.el-input__inner) {
  width: 100%;
}

:deep(.demo-form-inline .el-select) {
  width: 100%;
  margin: 0;
}

.el-select {
  width: 100%;
  margin: 0;
}

.selectLabel {
  width: 70%;
  min-height: 40px;
  line-height: 40px;
  padding: 0 15px;
  border: 1px solid #ccc;
  border-radius: 6px;
  display: inline-block;
}

.addLabel {
  display: inline-block;
  width: 120px;
  height: 30px;
  line-height: 30px;
  text-align: center;
  background-color: #169bd5;
  border-radius: 6px;
  color: #fff;
  margin-left: 15px;
}

.unitBox {
  width: 100%;
  margin: 30px 0;

  .title {
    padding: 15px 0;
    border-bottom: 1px solid #ccc;
  }

  .tagBox {
    line-height: 40px;
    margin-top: 15px;
    border: 1px solid #ccc;
    border-radius: 8px;
    padding: 10px 15px;
  }
}

.el-tag {
  margin-right: 10px;
}

.selectLabel {
  width: 70%;
  min-height: 40px;
  line-height: 40px;
  padding: 0 15px;
  border: 1px solid #ccc;
  border-radius: 6px;
  display: inline-block;
}

.content-box {
  width: 250px;
  height: 33px;
  padding: 5px;
  box-sizing: border-box;
  border: 1px solid #dcdfe6;
  border-radius: 4px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.select {
  color: #eee;
}

.align-center {
  align-items: center;
}

.space-between {
  justify-content: space-between;
}

.mt20 {
  margin-top: 20px;
}

.flex {
  display: flex;
}

.handle {
  position: absolute;
  top: 17px;
  right: 20px;
  display: flex;
  align-items: center;
}

.search-box {
  display: flex;
  justify-content: end;
  align-items: center;
  margin-bottom: 10px;
}
</style>
